package com.xtwy.controller;

import com.xtwy.rest.api.RestApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @作 者: 侯建军
 * @日 期: 2018/8/3 22:40
 * @描 述:
 * @公 司：山西迅腾伟业
 */
@Api(value = "Rest控制器")
@RestController
public class RestTemplateController {
    @Autowired
    private RestApiService restApiService;

    /**
     * 调用模板方法
     * localhost:9030/user/test
     * @param name
     * @return
     */
    @ApiOperation(value = "根据用户名查询用户信息", httpMethod = "GET", produces = "application/json")
    @GetMapping("/user/test")
    public String test(@RequestParam(required = false,defaultValue = "admin") String name){
        return restApiService.apiTest(name);
    }
}
